#ifndef __UDP_SERVER_H__
#define __UDP_SERVER_H__

#include "BaseThread/BaseThread.h"
#include "ServerProcessor.h"
#include <vector>
#include "Poco/Mutex.h"
#include "Poco/Net/DatagramSocket.h"

class RUDPServer : public Poco::Net::DatagramSocket
{
public:
    RUDPServer(int iPort);
};

class UdpServer : public BaseThread
{
public:
    UdpServer(int iPort, ServerProcessor* stProcess);
    ~UdpServer();

public:
    int Port(){ return m_iPort; }

protected:
    virtual int SingleStep();

private:
    int               m_iPort;

private:
    RUDPServer              *m_pudpserver;
    Poco::Mutex             m_mutexOperate;

private:
    ServerProcessor         *m_pProcessor;
};

#endif//__UDP_SERVER_H__
